<script>
    function goBack(){
    window.history.back()
    }

</script>
<div class="container-fluid">
    <h3 style="color:#8C525B;border-bottom:1px solid #F1F1F1;padding-bottom:10px;padding-left:10px;">添加客户</h3>
    <div class="panel panel-default">
        <div class="panel-heading">
            <h3 class="panel-title">添加客户信息</h3>
        </div>
        <div class="panel-body">
            <form action="c_action.php?action=add" method="post">
                <table class="c_add_table">
                    <tr>
                        <td>
                            <label for="">客户姓名</label>
                            <div><input type="text" class="form-control"  name="c_name" required="required" value="<?php echo isset($rows)?$rows['c_name']:''?>" /></div>
                        </td>
                        <td>
                            <label for="">客户来源</label>
                            <div>
                                <select class="form-control c_add_select" name="c_source" required="required">
                                  <?php if(isset($sourceArr)):?>
                                    <?php foreach($sourceArr as $v):?>
                                  <option><?php echo $v['csource_id'].$v['csource_info']?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                                </select>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="">客户职位</label>
                            <div>
                            <input type="text" class="form-control" name="c_post" value="<?php echo isset($rows)?$rows['c_post']:''?>" required="required"/>
                            </div>
                        </td>
                        <td>
                            <label for="">客户类别</label>
                            <select class="form-control c_add_select" name="c_type" required="required">
                                  <?php if(isset($typeArr)):?>
                                    <?php foreach($typeArr as $v):?>
                                  <option><?php echo $v['ctype_id'].$v['ctype_info']?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="">客户性别</label>
                            <div class="radio-inline">
                                <input type="radio" name="c_sex" value="男" />
                                <span>男</span>
                                <input type="radio" name="c_sex" value="女" style="margin-left:10px;"/>
                                <span style="margin-left:30px;">女</span>
                            </div>
                        </td>
                        <td>
                            <label for="">E-Mail</label>
                            <div><input type="text" name="c_email" class="form-control" value="<?php echo isset($rows)?$rows['c_email']:''?>" required="required"/></div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="">出生日期</label>
                            <div><input type="date" name="c_birthday" class="form-control" value="<?php echo isset($rows)?$rows['c_birthday']:''?>" required="required" placeholder="格式为年月日 如:19940404"/></div>
                        </td>
                        <td>
                            <label for="">客户状态</label>
                            <select name="c_stat" class="form-control c_add_select" required="required">
                                  <?php if(isset($statArr)):?>
                                    <?php foreach($statArr as $v):?>
                                  <option><?php echo $v['cstat_id'].$v['cstat_stat']?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="">客户手机</label>
                            <div><input name="c_tel" type="tel" class="form-control" value="<?php echo isset($rows)?$rows['c_tel']:''?>" required="required"/></div>
                        </td>
                        <td>
                            <label for="">客户QQ</label>
                            <div><input name="c_qq" type="text" class="form-control" value="<?php echo isset($rows)?$rows['c_qq']:''?>"/></div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="">客户地址</label>
                            <div><input name="c_addr" type="text" class="form-control" value="<?php echo isset($rows)?$rows['c_addr']:''?>" required="required"/></div>
                        </td>
                        <td>
                            <label for="">修改人</label>
                            <select name="c_udamin" class="form-control c_add_select" required="required">
                                  <?php if(isset($adminArr)):?>
                                    <?php foreach($adminArr as $v):?>
                                  <option><?php echo $v['admin_id'].$v['admin_name']?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="">创建人</label>
                            <select name="c_cadmin" class="form-control c_add_select">
                                  <?php if(isset($adminArr)):?>
                                    <?php foreach($adminArr as $v):?>
                                  <option><?php echo $v['admin_id'].$v['admin_name']?></option>
                                    <?php endforeach;?>
                                    <?php endif;?>
                            </select>
                        </td>
                        <td>
                            <label for="">客户微博</label>
                            <div><input name="c_weibo" type="text" class="form-control" value="<?php echo isset($rows)?$rows['c_weibo']:''?>"/></div>
                        </td>
                    </tr>
                    <tr>
                        <td>
                            <label for="">客户座机</label>
                            <div><input name="c_hometel" type="text" class="form-control" value="<?php echo isset($rows)?$rows['c_hometel']:''?>"/></div>
                        </td>
                        <td>
                            <label for="">客户MSN</label>
                            <div><input name="c_msn" type="text" class="form-control" value="<?php echo isset($rows)?$rows['c_msn']:''?>"/></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <label for="">客户公司</label>
                            <div><input name="c_company" type="text" class="form-control" value="<?php echo isset($rows)?$rows['c_company']:''?>"/></div>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2">
                            <label for="">备注</label>
                            <div>
                                <textarea name="c_comment" cols="90" rows="8" class="form-control" value="<?php echo isset($rows)?$rows['c_comment']:''?>"></textarea>
                            </div>
                        </td>
                    </tr>
                    <tr>
                        <td style="padding-left:100px;">
                            <button class="btn btn-primary" id="submit_btn" type="submit">提交</button>
                            <button class="btn btn-info" type="reset">重置</button>
                            <a class="btn btn-default" onclick="goBack()">返回</a>
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>